package com.sysmanagment.dao.user;

import java.util.List;

import org.jboss.seam.annotations.Name;

import com.sysmanagment.dao.DAOImpl;
import com.sysmanagment.model.user.Role;

@Name(value = "roleDAO")
public class RoleDAOImpl extends DAOImpl<Role> implements RoleDAO {

	@Override
	protected Class<Role> getEntityClass() {
		return Role.class;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Role> getAllRoles() {
		String query = "SELECT r FROM Role r";
		List<Role> all = entityManager.createQuery(query).getResultList();
		return all;
	}
}
